package com.tengju.bff.interfaces.covercharge.constant;

/**
 * 发票枚举
 *
 * @author fwy
 */
public enum InvoiceEnum {

    ZZSZYFP(1,"增值税专用发票"),
    ZZSPTFP(2,"增值税普通发票"),
    PTJDFP(3,"普通机打发票");

    private Integer code;
    private String desc;

    InvoiceEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode(){
        return this.code;
    }
    public String getDesc(){
        return this.desc;
    }

    public static InvoiceEnum getInvoiceDesc (Integer code){
        for(InvoiceEnum invoiceEnum : (InvoiceEnum.values())){
            if(invoiceEnum.getCode().equals(code)){//如果传入的code与此枚举code相同，则返回此枚举
                return invoiceEnum;
            }
        }
        return null;
    }

}
